unit uUserAuthentic;

interface

uses Variants, codemyth.utils, Types;

procedure SetInfo( const user, password: string );
function GetInfo: Variant;
function EncodeInfo( const user, password: string ): TStringDynArray;
function DecodeUser( const info: TStringDynArray ): string;
function DecodePassword( const Info: TStringDynArray ): string;

implementation

var
    my_info              : Variant;

procedure SetInfo( const user, password: string );
begin
    my_info := StringArray2VariantArray( EncodeInfo( user, password ) );
    
end;

function GetInfo: Variant;
begin
    Result := my_info;
end;

function EncodeInfo( const user, password: string ): TStringDynArray;
begin
    SetLength( Result, 2 );
    Result [0] := user;
    Result [1] := password;
end;

function DecodeUser( const info: TStringDynArray ): string;
begin
    Result := info [0];
end;

function DecodePassword( const Info: TStringDynArray ): string;
begin
    Result := info [1];
end;

initialization
    SetInfo('','');

end.

